/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tests.domainModel;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import domainModel.Member;
import static org.junit.Assert.*;

/**
 *
 * @author iziko
 */
public class MemberTest {

    Member instance;
    Member friend;


    public MemberTest() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }

    @Before
    public void setUp() {
           instance = new Member(1,"iziko","iz@mail","izik","orgad");
            friend =   new Member(2,"izikFriend","iz@mail","izik","orgad");
    }

    @After
    public void tearDown() {
    }

    /**
     * Test of addFriend method, of class Member.
     */
    @Test
    public void testAddFriend() {
        System.out.println("addFriend");
        instance.addFriend(friend);
        assertTrue(instance.getFriends().contains(friend));
    }

    /**
     * Test of removeFriend method, of class Member.
     */
    @Test
    public void testRemoveFriend() {
        System.out.println("removeFriend");
        instance.removeFriend(friend);
        assertFalse(instance.getFriends().contains(friend));

    }

    /**
     * Test of getEmail method, of class Member.
     */
    @Test
    public void testGetEmail() {
        System.out.println("getEmail");
        String expResult = "iz@mail";
        String result = instance.getEmail();
    }

    /**
     * Test of getFirstName method, of class Member.
     */
    @Test
    public void testGetFirstName() {
        System.out.println("getFirstName");
        String expResult = "izik";
        String result = instance.getFirstName();
        assertEquals(expResult, result);
    }

    /**
     * Test of getId method, of class Member.
     */
    @Test
    public void testGetId() {
        System.out.println("getId");
        int expResult = 1;
        int result = instance.getId();
        assertEquals(expResult, result);
    }

    /**
     * Test of getLastName method, of class Member.
     */
    @Test
    public void testGetLastName() {
        System.out.println("getLastName");
        String expResult = "orgad";
        String result = instance.getLastName();
        assertEquals(expResult, result);
    }

    /**
     * Test of getUserName method, of class Member.
     */
    @Test
    public void testGetUserName() {
        System.out.println("getUserName");
        String expResult = "iziko";
        String result = instance.getUserName();
        assertEquals(expResult, result);
    }

    /**
     * Test of setEmail method, of class Member.
     */
    @Test
    public void testSetEmail() {
        System.out.println("setEmail");
        String email = "iz2@mail";
        instance.setEmail(email);
        assertEquals(email,instance.getEmail());
    }

    /**
     * Test of setFirstName method, of class Member.
     */
    @Test
    public void testSetFirstName() {
        System.out.println("setFirstName");
        String firstName = "koko";
        instance.setFirstName(firstName);
        assertEquals(firstName,instance.getFirstName());
    }

    /**
     * Test of setId method, of class Member.
     */
    @Test
    public void testSetId() {
        System.out.println("setId");
        int id = 5;
        instance.setId(id);
        assertEquals(id,instance.getId());
    }

    /**
     * Test of setLastName method, of class Member.
     */
    @Test
    public void testSetLastName() {
        System.out.println("setLastName");
        String lastName = "momo";
        instance.setLastName(lastName);
        assertEquals(lastName,instance.getLastName());
    }

    /**
     * Test of setUserName method, of class Member.
     */
    @Test
    public void testSetUserName() {
        System.out.println("setUserName");
        String userName = "izik3";
        instance.setUserName(userName);
            assertEquals(userName,instance.getUserName());
    }


}